home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 74 6d | 70 6e 65 77 73 2e 63 72 |Path: tm|pnews.cr|
|00000010| 64 2e 67 65 2e 63 6f 6d | 21 72 65 62 65 63 63 61 |d.ge.com|!rebecca|
|00000020| 21 72 70 69 21 75 73 65 | 6e 65 74 0a 46 72 6f 6d |!rpi!use|net.From|
|00000030| 3a 20 42 6f 77 64 65 6e | 20 57 69 73 65 20 3c 77 |: Bowden| Wise <w|
|00000040| 69 73 65 62 40 63 73 2e | 72 70 69 2e 65 64 75 3e |iseb@cs.|rpi.edu>|
|00000050| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 63 6f 6d |.Newsgro|ups: com|
|00000060| 70 2e 6c 61 6e 67 2e 63 | 2b 2b 0a 53 75 62 6a 65 |p.lang.c|++.Subje|
|00000070| 63 74 3a 20 52 65 3a 20 | 42 75 67 20 6f 72 20 46 |ct: Re: |Bug or F|
|00000080| 65 61 74 75 72 65 3f 20 | 63 6f 6e 73 74 20 69 6e |eature? |const in|
|00000090| 74 20 76 61 72 69 61 62 | 6c 65 73 20 64 6f 20 6e |t variab|les do n|
|000000a0| 6f 74 20 65 78 70 6f 72 | 74 20 69 6e 20 67 63 63 |ot expor|t in gcc|
|000000b0| 20 32 2e 37 2e 30 0a 44 | 61 74 65 3a 20 46 72 69 | 2.7.0.D|ate: Fri|
|000000c0| 2c 20 30 39 20 46 65 62 | 20 31 39 39 36 20 31 31 |, 09 Feb| 1996 11|
|000000d0| 3a 31 35 3a 32 35 20 2d | 30 38 30 30 0a 4f 72 67 |:15:25 -|0800.Org|
|000000e0| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 52 65 6e 73 73 |anizatio|n: Renss|
|000000f0| 65 6c 61 65 72 20 50 6f | 6c 79 74 65 63 68 6e 69 |elaer Po|lytechni|
|00000100| 63 20 49 6e 73 74 69 74 | 75 74 65 2c 20 43 6f 6d |c Instit|ute, Com|
|00000110| 70 75 74 65 72 20 53 63 | 69 65 6e 63 65 0a 4d 65 |puter Sc|ience.Me|
|00000120| 73 73 61 67 65 2d 49 44 | 3a 20 3c 33 31 31 42 39 |ssage-ID|: <311B9|
|00000130| 44 34 44 2e 37 31 31 45 | 40 63 73 2e 72 70 69 2e |D4D.711E|@cs.rpi.|
|00000140| 65 64 75 3e 0a 52 65 66 | 65 72 65 6e 63 65 73 3a |edu>.Ref|erences:|
|00000150| 20 3c 34 66 64 6c 65 65 | 24 62 70 66 40 6e 65 74 | <4fdlee|$bpf@net|
|00000160| 6c 61 62 2e 63 73 2e 72 | 70 69 2e 65 64 75 3e 0a |lab.cs.r|pi.edu>.|
|00000170| 4e 4e 54 50 2d 50 6f 73 | 74 69 6e 67 2d 48 6f 73 |NNTP-Pos|ting-Hos|
|00000180| 74 3a 20 68 6f 6f 76 65 | 72 2e 63 73 2e 72 70 69 |t: hoove|r.cs.rpi|
|00000190| 2e 65 64 75 0a 4d 69 6d | 65 2d 56 65 72 73 69 6f |.edu.Mim|e-Versio|
|000001a0| 6e 3a 20 31 2e 30 0a 43 | 6f 6e 74 65 6e 74 2d 54 |n: 1.0.C|ontent-T|
|000001b0| 79 70 65 3a 20 74 65 78 | 74 2f 70 6c 61 69 6e 3b |ype: tex|t/plain;|
|000001c0| 20 63 68 61 72 73 65 74 | 3d 75 73 2d 61 73 63 69 | charset|=us-asci|
|000001d0| 69 0a 43 6f 6e 74 65 6e | 74 2d 54 72 61 6e 73 66 |i.Conten|t-Transf|
|000001e0| 65 72 2d 45 6e 63 6f 64 | 69 6e 67 3a 20 37 62 69 |er-Encod|ing: 7bi|
|000001f0| 74 0a 58 2d 4d 61 69 6c | 65 72 3a 20 4d 6f 7a 69 |t.X-Mail|er: Mozi|
|00000200| 6c 6c 61 20 32 2e 30 62 | 36 61 20 28 57 69 6e 31 |lla 2.0b|6a (Win1|
|00000210| 36 3b 20 49 29 0a 54 6f | 3a 20 49 76 6f 20 57 65 |6; I).To|: Ivo We|
|00000220| 6c 63 68 20 3c 69 76 6f | 2e 77 65 6c 63 68 40 41 |lch <ivo|.welch@A|
|00000230| 47 53 4d 2e 55 43 4c 41 | 2e 45 44 55 3e 0a 0a 49 |GSM.UCLA|.EDU>..I|
|00000240| 76 6f 20 57 65 6c 63 68 | 20 77 72 6f 74 65 3a 0a |vo Welch| wrote:.|
|00000250| 3e 20 0a 3e 20 4f 6e 20 | 61 20 4e 65 78 74 53 74 |> .> On |a NextSt|
|00000260| 65 70 2f 46 49 50 20 73 | 79 73 74 65 6d 20 77 2f |ep/FIP s|ystem w/|
|00000270| 20 67 63 63 20 32 2e 37 | 2e 30 3a 0a 3e 20 0a 3e | gcc 2.7|.0:.> .>|
|00000280| 20 46 69 6c 65 20 74 72 | 79 32 2e 63 63 3a 0a 3e | File tr|y2.cc:.>|
|00000290| 20 20 20 20 20 20 20 20 | 20 69 6e 74 20 65 78 31 | | int ex1|
|000002a0| 3d 32 3b 0a 3e 20 0a 3e | 20 46 69 6c 65 20 74 72 |=2;.> .>| File tr|
|000002b0| 79 31 2e 63 63 3a 0a 3e | 20 20 20 20 20 20 20 20 |y1.cc:.>| |
|000002c0| 20 65 78 74 65 72 6e 20 | 22 43 22 20 7b 0a 3e 20 | extern |"C" {.> |
|000002d0| 20 20 20 20 20 20 20 20 | 23 69 6e 63 6c 75 64 65 | |#include|
|000002e0| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 3e 20 20 20 20 | <stdio.|h>.> |
|000002f0| 20 20 20 20 20 7d 0a 3e | 20 0a 3e 20 20 20 20 20 | }.>| .> |
|00000300| 20 20 20 20 69 6e 74 20 | 6d 61 69 6e 28 29 20 7b | int |main() {|
|00000310| 0a 3e 20 20 20 20 20 20 | 20 20 20 20 20 65 78 74 |.> | ext|
|00000320| 65 72 6e 20 69 6e 74 20 | 65 78 31 3b 20 70 72 69 |ern int |ex1; pri|
|00000330| 6e 74 66 28 22 45 78 74 | 65 72 6e 20 3d 20 25 64 |ntf("Ext|ern = %d|
|00000340| 5c 6e 22 2c 20 65 78 31 | 29 3b 20 72 65 74 75 72 |\n", ex1|); retur|
|00000350| 6e 20 30 3b 20 7d 0a 3e | 20 0a 3e 20 77 6f 72 6b |n 0; }.>| .> work|
|00000360| 73 2c 20 62 75 74 20 69 | 66 20 49 20 72 65 70 6c |s, but i|f I repl|
|00000370| 61 63 65 20 22 69 6e 74 | 22 20 77 69 74 68 20 22 |ace "int|" with "|
|00000380| 63 6f 6e 73 74 20 69 6e | 74 22 20 69 6e 20 62 6f |const in|t" in bo|
|00000390| 74 68 20 73 69 74 75 61 | 74 69 6f 6e 73 2c 20 74 |th situa|tions, t|
|000003a0| 68 65 0a 3e 20 6c 69 6e | 6b 65 72 20 63 6f 6d 70 |he.> lin|ker comp|
|000003b0| 6c 61 69 6e 73 20 74 68 | 61 74 20 65 78 31 20 69 |lains th|at ex1 i|
|000003c0| 73 20 6e 6f 74 20 64 65 | 66 69 6e 65 64 2e 20 20 |s not de|fined. |
|000003d0| 4e 4f 54 45 20 74 68 61 | 74 20 69 74 20 77 6f 72 |NOTE tha|t it wor|
|000003e0| 6b 73 20 77 69 74 68 0a | 3e 20 22 63 6f 6e 73 74 |ks with.|> "const|
|000003f0| 22 20 69 6e 20 67 63 63 | 20 69 66 20 69 6e 73 74 |" in gcc| if inst|
|00000400| 65 61 64 20 6f 66 20 43 | 2b 2b 20 49 20 73 77 69 |ead of C|++ I swi|
|00000410| 74 63 68 20 74 6f 20 70 | 6c 61 69 6e 20 43 2e 0a |tch to p|lain C..|
|00000420| 0a 54 68 69 73 20 69 73 | 20 62 65 63 61 75 73 65 |.This is| because|
|00000430| 20 69 6e 20 43 2b 2b 2c | 20 63 6f 6e 73 74 20 6f | in C++,| const o|
|00000440| 62 6a 65 63 74 73 20 61 | 72 65 20 73 74 61 74 69 |bjects a|re stati|
|00000450| 63 61 6c 6c 79 20 6c 69 | 6e 6b 65 64 2c 20 77 68 |cally li|nked, wh|
|00000460| 65 72 65 61 73 20 0a 41 | 4e 53 49 20 43 2c 20 74 |ereas .A|NSI C, t|
|00000470| 68 65 20 64 65 66 61 75 | 6c 74 20 6c 69 6e 6b 61 |he defau|lt linka|
|00000480| 67 65 20 6f 66 20 61 20 | 73 74 61 74 69 63 20 69 |ge of a |static i|
|00000490| 73 20 65 78 74 65 72 6e | 2e 0a 0a 53 6f 20 69 6e |s extern|...So in|
|000004a0| 20 74 68 65 20 66 69 72 | 73 74 20 63 61 73 65 2c | the fir|st case,|
|000004b0| 20 77 68 65 6e 20 74 68 | 65 20 65 78 31 20 69 73 | when th|e ex1 is|
|000004c0| 20 6e 6f 74 20 63 6f 6e | 73 74 2c 20 74 68 65 20 | not con|st, the |
|000004d0| 73 74 61 74 65 6d 65 6e | 74 0a 3e 20 20 20 20 20 |statemen|t.> |
|000004e0| 20 20 20 20 69 6e 74 20 | 65 78 31 3d 32 3b 64 65 | int |ex1=2;de|
|000004f0| 66 69 6e 65 73 20 61 20 | 47 4c 4f 42 41 4c 20 76 |fines a |GLOBAL v|
|00000500| 61 72 69 61 62 6c 65 2c | 20 77 68 69 63 68 20 63 |ariable,| which c|
|00000510| 61 6e 20 62 65 20 72 65 | 74 72 69 65 76 65 64 20 |an be re|trieved |
|00000520| 62 79 20 61 6e 6f 74 68 | 65 72 20 0a 74 72 61 6e |by anoth|er .tran|
|00000530| 73 6c 61 74 69 6f 6e 20 | 20 75 6e 69 74 20 75 73 |slation | unit us|
|00000540| 69 6e 67 20 65 78 74 65 | 72 6e 20 61 73 20 79 6f |ing exte|rn as yo|
|00000550| 75 20 68 61 76 65 20 64 | 6f 6e 65 2e 0a 0a 48 6f |u have d|one...Ho|
|00000560| 77 65 76 65 72 2c 20 63 | 68 61 6e 67 69 6e 67 20 |wever, c|hanging |
|00000570| 74 6f 20 63 6f 6e 73 74 | 2c 20 72 65 73 75 6c 74 |to const|, result|
|00000580| 73 20 69 6e 0a 20 20 20 | 63 6f 6e 73 74 20 69 6e |s in. |const in|
|00000590| 74 20 65 78 31 3d 32 3b | 0a 62 65 69 6e 67 20 6c |t ex1=2;|.being l|
|000005a0| 69 6e 6b 65 64 20 73 74 | 61 74 69 63 61 6c 6c 79 |inked st|atically|
|000005b0| 20 69 6e 20 74 72 79 32 | 2e 63 63 2c 20 62 75 74 | in try2|.cc, but|
|000005c0| 20 62 65 63 61 75 73 65 | 20 69 74 20 69 73 20 73 | because| it is s|
|000005d0| 74 61 74 69 63 61 6c 6c | 79 0a 6c 69 6e 6b 65 64 |taticall|y.linked|
|000005e0| 20 69 74 20 69 73 20 6e | 6f 74 20 76 69 73 69 62 | it is n|ot visib|
|000005f0| 6c 65 20 74 6f 20 74 72 | 79 31 2e 63 63 20 73 6f |le to tr|y1.cc so|
|00000600| 20 75 73 69 6e 67 20 65 | 78 74 65 72 6e 2c 20 69 | using e|xtern, i|
|00000610| 74 20 63 61 6e 6e 6f 74 | 20 66 69 6e 64 0a 74 68 |t cannot| find.th|
|00000620| 65 20 76 61 72 69 61 62 | 6c 65 2e 20 20 0a 0a 59 |e variab|le. ..Y|
|00000630| 6f 75 20 6e 65 65 64 20 | 74 6f 20 63 72 65 61 74 |ou need |to creat|
|00000640| 65 20 61 20 68 65 61 64 | 65 72 20 66 69 6c 65 20 |e a head|er file |
|00000650| 66 6f 72 20 63 6f 6e 73 | 74 61 6e 74 73 3a 0a 0a |for cons|tants:..|
|00000660| 20 20 2f 2f 74 72 79 2e | 68 0a 20 20 63 6f 6e 73 | //try.|h. cons|
|00000670| 74 20 69 6e 74 20 65 78 | 31 3d 32 3b 0a 0a 41 6e |t int ex|1=2;..An|
|00000680| 64 20 73 69 6d 70 6c 79 | 20 69 6e 63 6c 75 64 65 |d simply| include|
|00000690| 20 74 68 65 20 68 65 61 | 64 65 72 20 69 6e 20 65 | the hea|der in e|
|000006a0| 76 65 72 79 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |very tra|nslation|
|000006b0| 20 75 6e 69 74 20 74 68 | 61 74 20 6e 65 65 64 73 | unit th|at needs|
|000006c0| 20 0a 69 74 2e 20 20 59 | 6f 75 20 73 68 6f 75 6c | .it. Y|ou shoul|
|000006d0| 64 20 4e 4f 54 20 70 75 | 74 20 6e 6f 6e 2d 73 74 |d NOT pu|t non-st|
|000006e0| 61 74 69 63 20 76 61 72 | 69 61 62 6c 65 73 20 69 |atic var|iables i|
|000006f0| 6e 20 68 65 61 64 65 72 | 20 66 69 6c 65 73 2e 20 |n header| files. |
|00000700| 20 59 6f 75 0a 63 61 6e | 20 70 75 74 20 65 78 74 | You.can| put ext|
|00000710| 65 72 6e 73 20 69 6e 20 | 68 65 61 64 65 72 20 66 |erns in |header f|
|00000720| 69 6c 65 73 2c 20 62 75 | 74 20 74 68 65 20 64 65 |iles, bu|t the de|
|00000730| 66 69 6e 69 74 69 6f 6e | 73 20 6d 75 73 74 20 62 |finition|s must b|
|00000740| 65 0a 69 6e 63 6c 75 64 | 65 64 20 6f 6e 63 65 3a |e.includ|ed once:|
|00000750| 0a 0a 20 20 2f 2f 74 72 | 79 2e 68 0a 20 20 63 6f |.. //tr|y.h. co|
|00000760| 6e 73 74 20 20 69 6e 74 | 20 65 78 31 3d 32 3b 0a |nst int| ex1=2;.|
|00000770| 20 20 65 78 74 65 72 6e | 20 69 6e 74 20 65 78 32 | extern| int ex2|
|00000780| 3b 0a 0a 20 20 2f 2f 74 | 72 79 2e 63 63 0a 20 20 |;.. //t|ry.cc. |
|00000790| 69 6e 74 20 65 78 32 3d | 33 3b 0a 0a 20 20 2f 2f |int ex2=|3;.. //|
|000007a0| 20 6d 61 69 6e 2e 63 63 | 0a 20 20 23 69 6e 63 6c | main.cc|. #incl|
|000007b0| 75 64 65 20 22 74 72 79 | 2e 68 22 0a 20 20 65 78 |ude "try|.h". ex|
|000007c0| 74 65 72 6e 20 22 43 22 | 0a 20 20 7b 0a 20 20 23 |tern "C"|. {. #|
|000007d0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|000007e0| 3e 0a 20 20 7d 20 0a 20 | 20 76 6f 69 64 20 6d 61 |>. } . | void ma|
|000007f0| 69 6e 28 29 0a 20 20 7b | 0a 20 20 20 20 20 70 72 |in(). {|. pr|
|00000800| 69 6e 74 66 28 22 43 6f | 6e 73 74 20 20 3d 20 25 |intf("Co|nst = %|
|00000810| 64 5c 6e 22 2c 20 65 78 | 31 29 3b 0a 20 20 20 20 |d\n", ex|1);. |
|00000820| 20 70 72 69 6e 74 66 28 | 22 45 78 74 65 72 6e 20 | printf(|"Extern |
|00000830| 3d 20 25 64 5c 6e 22 2c | 20 65 78 32 29 3b 0a 20 |= %d\n",| ex2);. |
|00000840| 20 7d 0a 0a 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | }..----|--------|
|00000850| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000860| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000870| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000880| 2d 2d 2d 2d 2d 2d 2d 2d | 0a 47 2e 20 42 6f 77 64 |--------|.G. Bowd|
|00000890| 65 6e 20 57 69 73 65 0a | 43 6f 6d 70 75 74 65 72 |en Wise.|Computer|
|000008a0| 20 53 63 69 65 6e 63 65 | 20 44 65 70 74 2c 20 52 | Science| Dept, R|
|000008b0| 65 6e 73 73 65 6c 61 65 | 72 20 50 6f 6c 79 74 65 |ensselae|r Polyte|
|000008c0| 63 68 6e 69 63 20 49 6e | 73 74 2c 20 54 72 6f 79 |chnic In|st, Troy|
|000008d0| 2c 20 4e 59 20 31 32 31 | 38 30 0a 45 6d 61 69 6c |, NY 121|80.Email|
|000008e0| 3a 20 77 69 73 65 62 40 | 63 73 2e 72 70 69 2e 65 |: wiseb@|cs.rpi.e|
|000008f0| 64 75 20 20 20 20 20 20 | 20 20 20 57 57 57 3a 20 |du | WWW: |
|00000900| 68 74 74 70 3a 2f 2f 77 | 77 77 2e 63 73 2e 72 70 |http://w|ww.cs.rp|
|00000910| 69 2e 65 64 75 2f 7e 77 | 69 73 65 62 2f 0a |i.edu/~w|iseb/. |
+--------+-------------------------+-------------------------+--------+--------+